#ifndef __LIDAR_DATA_COLLECT_H__
#define __LIDAR_DATA_COLLECT_H__

#include <ros/ros.h>
#include "comm/comm_base.h"
#include "comm_extend/comm_base_extend.h"
#include "pcpt_comm/pcpt_comm_ros.h"
#include "data_file.h"

#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>

#include "draco/compression/encode.h"
#include "draco/core/cycle_timer.h"
#include "draco/io/file_utils.h"
#include "draco/io/mesh_io.h"
#include "draco/io/point_cloud_io.h"
#include "draco/tools/draco_encoder.cc"

using namespace std;

/**************************************************************************************
功能描述: 激光雷达数据采集类
修改记录:
**************************************************************************************/
class LIDAR_DATA_COLLECT_C
{
public:
    LIDAR_DATA_COLLECT_C(ros::NodeHandle &nh, string lidarName)
      : objLidarMsgRec_(nh, lidarName)
    {
        strPrefix_ = GetPrefix(lidarName);
    }

    ~LIDAR_DATA_COLLECT_C(){}

    int  Init();
    void DataCollect();

private:
    LIDAR_MSG_RECEIVER_C        objLidarMsgRec_;
    DATA_FILE_C                 objDataFile_;

    string                      strPrefix_;
    string                      strPcdDirPath_;
    string                      strPlyDirPath_;
    string                      strBinDirPath_;
    string                      strDrcDirPath_;

    string GetPrefix(const string &lidarName) const;
    string SensorMsg2Pcd(const MyCloud::Ptr pCloud) const;
    string SensorMsg2Ply(const MyCloud::Ptr pCloud) const;
    string SensorMsg2Bin(const MyCloud::Ptr pCloud) const;
    int    DracoEndoder(string fileName);
};

#endif